#!/bin/bash	
# Run on ship to 'rsync' uplink and downlink directories with shore, via 
# DTN tunneling, as described at www.dtnrg.org/wiki/DTN_Rsync  
# This script can be run as a cron job, but to avoid password prompt you must
# set up the remote host for password-less ssh login, per 
# http://www.debian-administration.org/articles/152

# Push-sync downlink to shore
rsync -e "ssh -p 10022" -rav ~/mydtn/dtnsync/downlink dtnuser@localhost:mydtn/dtnsync

# Pull-sync uplink from shore
rsync -e "ssh -p 10022" -rav dtnuser@localhost:mydtn/dtnsync/uplink ~/mydtn/dtnsync